package com.mangatta.ec2.util;

import java.util.HashMap;

public class InstanceAlertMap extends HashMap<String, String> {
    private static final long serialVersionUID = -5985560202898830102L;
	public static final String KEY_INSTANCE_ID = "instanceId";
    public static final String KEY_ALERT_METRICS = "alertMetrics";

    private String instanceId;
    private String alertMetrics;

    public InstanceAlertMap(String instanceId, String alertMetrics) {
        this.instanceId = instanceId;
        this.alertMetrics = alertMetrics;
    }

    public String getInstanceId() {
        return instanceId;
    }

    public void setInstanceId(String instanceId) {
        this.instanceId = instanceId;
    }

    public String getAlertMetrics() {
        return alertMetrics;
    }

    public void setAlertMetrics(String alertMetrics) {
        this.alertMetrics = alertMetrics;
    }

    @Override
    public String get(Object k) {
        String key = (String) k;
        if (KEY_ALERT_METRICS.equals(key)) {
            return alertMetrics;
        }
        if (KEY_INSTANCE_ID.equals(key)) {
            return instanceId;
        }
        return super.get(k);
    }
}
